/*
 * Copyright 2020-2021 redragon.dongbin
 *
 * This file is part of redragon-erp/赤龙ERP.

 * redragon-erp/赤龙ERP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * redragon-erp/赤龙ERP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with redragon-erp/赤龙ERP.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.erp.cux.workflow.dao.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name="cux_workflow_conf_line", schema="erp")
@DynamicInsert(true)
@DynamicUpdate(true)
public class CuxWorkflowConfLine implements java.io.Serializable {

    //serialVersionUID
    private static final long serialVersionUID = 1L;

    //Constructors
    public CuxWorkflowConfLine() {
    }
    
    //Fields
    
    //主键
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "conf_line_id", unique = true, nullable = false)
    private Integer confLineId;
    
    public Integer getConfLineId() {
        return this.confLineId;
    }
    public void setConfLineId(Integer confLineId) {
        this.confLineId = confLineId;
    }
    
    //行编码
    @NotBlank(message="行编码不能为空")
    @Column(name = "conf_line_code", unique = true, nullable = false, length = 45)
    private String confLineCode;
    
    public String getConfLineCode() {
        return this.confLineCode;
    }
    public void setConfLineCode(String confLineCode) {
        this.confLineCode = confLineCode;
    }
    
    //头编码
    @NotBlank(message="头编码不能为空")
    @Column(name = "conf_head_code", unique = false, nullable = false, length = 45)
    private String confHeadCode;
    
    public String getConfHeadCode() {
        return this.confHeadCode;
    }
    public void setConfHeadCode(String confHeadCode) {
        this.confHeadCode = confHeadCode;
    }
    
    //序号（根据所处的节点位置，可重复）
    @NotNull(message="序号不能为空")
    @Column(name = "order_number", unique = false, nullable = false)
    private Integer orderNumber;
    
    public Integer getOrderNumber() {
        return this.orderNumber;
    }
    public void setOrderNumber(Integer orderNumber) {
        this.orderNumber = orderNumber;
    }
    
    //任务名称
    @NotBlank(message="任务名称不能为空")
    @Column(name = "task_name", unique = false, nullable = false, length = 45)
    private String taskName;
    
    public String getTaskName() {
        return this.taskName;
    }
    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }
    
    //任务描述
    @Column(name = "task_desc", unique = false, nullable = true, length = 200)
    private String taskDesc;
    
    public String getTaskDesc() {
        return this.taskDesc;
    }
    public void setTaskDesc(String taskDesc) {
        this.taskDesc = taskDesc;
    }
    
    //审批部门
    @Column(name = "approve_department", unique = false, nullable = true, length = 45)
    private String approveDepartment;
    
    public String getApproveDepartment() {
        return this.approveDepartment;
    }
    public void setApproveDepartment(String approveDepartment) {
        this.approveDepartment = approveDepartment;
    }
    
    //审批岗位
    @Column(name = "approve_position", unique = false, nullable = true, length = 45)
    private String approvePosition;
    
    public String getApprovePosition() {
        return this.approvePosition;
    }
    public void setApprovePosition(String approvePosition) {
        this.approvePosition = approvePosition;
    }
    
    //审批人
    @Column(name = "approve_person", unique = false, nullable = true, length = 45)
    private String approvePerson;
    
    public String getApprovePerson() {
        return this.approvePerson;
    }
    public void setApprovePerson(String approvePerson) {
        this.approvePerson = approvePerson;
    }
    
    //分支条件
    @Column(name = "branch_condition", unique = false, nullable = true, length = 45)
    private String branchCondition;
    
    public String getBranchCondition() {
        return this.branchCondition;
    }
    public void setBranchCondition(String branchCondition) {
        this.branchCondition = branchCondition;
    }
    
    //分支任务编码（行编码）
    @Column(name = "parent_task_code", unique = false, nullable = true, length = 45)
    private String parentTaskCode;
    
    public String getParentTaskCode() {
        return parentTaskCode;
    }
    public void setParentTaskCode(String parentTaskCode) {
        this.parentTaskCode = parentTaskCode;
    }

    //状态
    @Column(name = "status", unique = false, nullable = false, length = 1)
    private String status;
    
    public String getStatus() {
        return this.status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    
    //创建时间
    @Column(name = "created_date", unique = false, nullable = false)
    private Date createdDate;
    
    public Date getCreatedDate() {
        return this.createdDate;
    }
    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }
    
    //创建人
    @Column(name = "created_by", unique = false, nullable = false, length = 45)
    private String createdBy;
    
    public String getCreatedBy() {
        return this.createdBy;
    }
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }
    
    //最后修改时间
    @Column(name = "last_updated_date", unique = false, nullable = true)
    private Date lastUpdatedDate;
    
    public Date getLastUpdatedDate() {
        return this.lastUpdatedDate;
    }
    public void setLastUpdatedDate(Date lastUpdatedDate) {
        this.lastUpdatedDate = lastUpdatedDate;
    }
    
    //最后修改人
    @Column(name = "last_updated_by", unique = false, nullable = true, length = 45)
    private String lastUpdatedBy;
    
    public String getLastUpdatedBy() {
        return this.lastUpdatedBy;
    }
    public void setLastUpdatedBy(String lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }
    
    //组织机构
    @Column(name = "org_code", unique = false, nullable = false, length = 45)
    private String orgCode;
    
    public String getOrgCode() {
        return this.orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    
    
    
    /*
         * 显示字段
     */
    @Transient
    private String approveDepartmentDesc;
    @Transient
    private String approvePositionDesc;
    @Transient
    private String approvePersonDesc;
    @Transient
    private String parentTaskName;

    public String getApproveDepartmentDesc() {
        return approveDepartmentDesc;
    }
    public void setApproveDepartmentDesc(String approveDepartmentDesc) {
        this.approveDepartmentDesc = approveDepartmentDesc;
    }
    public String getApprovePositionDesc() {
        return approvePositionDesc;
    }
    public void setApprovePositionDesc(String approvePositionDesc) {
        this.approvePositionDesc = approvePositionDesc;
    }
    public String getApprovePersonDesc() {
        return approvePersonDesc;
    }
    public void setApprovePersonDesc(String approvePersonDesc) {
        this.approvePersonDesc = approvePersonDesc;
    }
    public String getParentTaskName() {
        return parentTaskName;
    }
    public void setParentTaskName(String parentTaskName) {
        this.parentTaskName = parentTaskName;
    }
    
}